//
//  Work_Web_Vc.swift
//  LocaLink
//
//  Created by Icy on 2017/1/19.
//  Copyright © 2017年 Icy. All rights reserved.
//

/*
 owner:cy
 update:2016年11月14日09:34:13
 info: work界面
 */
import RxSwift
import UtilCore

class Work_Web_Vc: Base_Vc {
    
    /****************************Storyboard UI设置区域****************************/
    
    @IBOutlet weak var web_Wb: UIWebView!
    
    /*----------------------------   自定义属性区域    ----------------------------*/
    
    var webUrl:String = "http://101.200.203.219:920/work.html"
    /****************************Storyboard 绑定方法区域****************************/
    
    
    
    /**************************** 以下是方法区域 ****************************/
    override func viewDidLoad() {
        super.viewDidLoad()
        
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        guard let url = NSURL(string:webUrl) else { return  }
        let request = NSMutableURLRequest(url: url as URL)
        self.web_Wb.loadRequest(request as URLRequest)
        
    }
    
    override func viewWillDisappear(_  animated: Bool) {
        super.viewWillDisappear(animated)
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        
    }
    /**
     界面基础设置
     */
    override func setupUI() {
        self.tabBarController?.tabBar.isHidden = true
        /**
         *  自定义 导航栏左侧 返回按钮
         */
        self.customLeftBarButtonItem()
        self.web_Wb.delegate = self
    }
    
    /**
     绑定到viewmodel 设置
     */
    override func bindToViewModel(){
        
    }
}
extension Work_Web_Vc:UIWebViewDelegate{
    func webViewDidStartLoad(_ webView: UIWebView){
        
    }
    func webViewDidFinishLoad(_ webView: UIWebView){
        self.title = webView.stringByEvaluatingJavaScript(from: "document.title")
    }
    func webView(_ webView: UIWebView, didFailLoadWithError error: Error){
        
    }
}

